<?php

use Illuminate\Database\Seeder;

class RepaySummaryTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $id = DB::table('repay_summaries')->insertGetId(
            ['uid' => 2,'loan_request_id' => 2,'loan_id' => 'LO201901082134462129724534085229','amount' => 1000,'period_count' => 3,'period' => 1,'rate' => json_encode([])]
        );
        $data = [[
            'uid' => 2,
            'summary_id' => $id,
            'bank_cards_id' => 1,
            'period' => 1,
            'amount' => 1000/3,
            'status' => 0,
            'pay_off' => 1,
            'normal_time' => date('Y-m-d',time())
        ],
        [
            'uid' => 2,
            'summary_id' => $id,
            'bank_cards_id' => 1,
            'period' => 2,
            'amount' => 1000/3,
            'status' => 0,
            'pay_off' => 1,
            'normal_time' => date('Y-m-d',time())
        ],
        [
            'uid' => 2,
            'summary_id' => $id,
            'bank_cards_id' => 1,
            'period' => 3,
            'amount' => 1000/3,
            'status' => 0,
            'pay_off' => 1,
            'normal_time' => date('Y-m-d',time())
        ]
        ];
        DB::table('repay_records')->insert($data);
    }
}
